<?php


namespace app\service\model;


use app\service\Y;

class MemberAddressModel extends BaseModel
{

    protected $table = 'member_address';

    public static function saveData($param, $id)
    {
        if ($id > 0) {
            $data = self::where('member_id', '=', $param['member_id'])->find($id);
            if (!$data) {
                return Y::error('参数错误');
            }

            $data->save($param);
        } else {
            self::create($param);
        }
        return Y::success([], '保存成功');
    }
}